@extends('layouts/admin')
    @section('content')
        <!--面包屑导航 开始-->
        <div class="crumb_warp">
            <!--<i class="fa fa-bell"></i> 欢迎使用登陆网站后台，建站的首选工具。-->
            <i class="fa fa-home"></i> <a href="{{url('admin/info')}}">首页</a> &raquo; 文章管理
        </div>
        <!--面包屑导航 结束-->

        <!--结果集标题与导航组件 开始-->
        <div class="result_wrap">
            <div class="result_title">
                <h3>编辑文章</h3>
            </div>
            <div class="result_content">
                <div class="short_wrap">
                    <a href="{{url('admin/article/create')}}"><i class="fa fa-plus"></i>添加文章</a>
                    <a href="{{url('admin/article')}}"><i class="fa fa-fw fa-list-ul"></i>全部文章</a>
                </div>
            </div>
        </div>
        <!--结果集标题与导航组件 结束-->
        @if(count($errors))
        <div class="result_title">
                <div class="mark">
                    <p style="color: red;">{{$errors}}</p>
                </div>
        </div>
        @endif
        @if(session('success'))
        <div class="result_title">
                <div class="mark" style="background-color: #66CC99;">
                    <p style="color: green;">{{session('success')}}</p>
                </div>
        </div>
        @endif
        <div class="result_wrap">
            <form action="{{url('admin/article/'.$article->art_id)}}" method="post" enctype="multipart/form-data">
                <input type="hidden" value="put" name="_method">
                {{csrf_field()}}
                <table class="add_tab">
                    <tbody>
                        <tr>
                            <th width="120">分类：</th>
                            <td>
                                <select name="">
                                    @foreach($data as $cate)
                                        <option value="{{$cate->cate_id}}"
                                            @if($article->cate_id == $cate->cate_id)
                                                selected
                                            @endif
                                        >
                                            @if($cate->cate_pid != 0)
                                                |---{{$cate->cate_name}}
                                            @else
                                                {{$cate->cate_name}}
                                            @endif
                                        </option>
                                    @endforeach
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th>文章标题：</th>
                            <td>
                                <input type="text" class="lg" value="{{$article->art_title}}" name="art_title">
                            </td>
                        </tr>
                        <tr>
                            <th>作者：</th>
                            <td>
                                <input type="text" class="sm"  value="{{$article->art_editor}}" name="art_editor">
                            </td>
                        </tr>
                        <tr>
                            <th>缩略图：</th>
                            <td>
                                <input id="file_upload" name="file_upload" type="file" multiple="true"><br>
                                <img style="width: 100px;padding-top: 10px;"  src="{{asset($article->art_thumb)}}" alt="找不到了">
                                
                            </td>
                        </tr>
                        <tr>
                            <th>关键字：</th>
                            <td>
                                <textarea name="art_tag">{{$article->art_tag}}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <th>描述：</th>
                            <td>
                                <textarea name="art_description">{{$article->art_description}}</textarea>
                            </td>
                        </tr>
                        <tr>
                            <th>文章内容：</th>
                            <td>
                                <style>
                                    .edui-default{line-height: 28px;}
                                    div.edui-combox-body,div.edui-button-body,div.edui-splitbutton-body
                                    {overflow: hidden; height:20px;}
                                    div.edui-box{overflow: hidden; height:22px;}
                                </style>
                                <!-- 加载编辑器的容器 -->
                                <script id="container" style="width: 850px;" name="art_content" type="text/plain">{{$article->art_content}}</script>
                                <!-- 配置文件 -->
                                <script type="text/javascript" src="{{asset('storage/ueditor/ueditor.config.js')}}"></script>
                                <!-- 编辑器源码文件 -->
                                <script type="text/javascript" src="{{asset('storage/ueditor/ueditor.all.js')}}"></script>
                                <!-- 实例化编辑器 -->
                                <script type="text/javascript">
                                    var ue = UE.getEditor('container');
                                </script>
                            </td>
                        </tr>
                        <tr>
                            <th></th>
                            <td>
                                <input type="submit" value="提交">
                                <input type="button" class="back" onclick="history.go(-1)" value="返回">
                            </td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </div>
    @endsection